<template>
    <div class="content">
        <el-button type="primary" icon="el-icon-plus" @click="toForm">Add</el-button>
        <div class="table-wrapper">
            <el-table
                    :data="saleList"
                    border
                    stripe
                    row-key="id"
                    style="width: 100%">
                <el-table-column
                        prop="salesProcessId"
                        label="合同评价编号"
                        width="180">
                </el-table-column>
                <el-table-column
                        prop="customerName"
                        label="客户姓名"
                        width="180">
                </el-table-column>
                <el-table-column
                        prop="submitDateStr"
                        label="填表日期">
                </el-table-column>
                <el-table-column
                        label="编辑"
                        prop=""
                        width="180">
                    <template slot-scope="scope">
                        <el-button
                                size="mini"
                                @click="detail(scope.row)">修改
                        </el-button>
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <div class="page">
            <el-pagination background
                           @current-change="changePage"
                           :page-size="pageSize"
                           layout="prev, pager, next"
                           :total="total">
            </el-pagination>
        </div>
    </div>
</template>

<script>
    import mixins from '../../util/mixins'
    import {showProcessList} from "../../api/quotation";
    import {ERROR_OK} from "../../util/config";

    export default {
        name: "contract-evaluation-list",
        mixins:[mixins],
        data(){
          return{
              saleList:[],
          }
        },
        methods: {
            toForm() {
                this.$router.push('/sales-eva/form')
            },
            //  获取展示列表信息
            async showProcessList(){
              const {status,data} = await showProcessList();
              if(status === ERROR_OK){
                  this.saleList = data
              }
            },

            detail(row){
                this.$router.push({path:'/sales-eva/form/'+row.id,query:{info:row}})
            },


        },
        created(){
            this.showProcessList()
        }


    }
</script>

<style scoped lang="scss">
    @import "../../css/mixins";
    .content{
        @include content
    }
</style>